package com.yyt.guavademo.controller;

import com.google.common.eventbus.EventBus;
import com.yyt.guavademo.eventbus.Consumer;
import com.yyt.guavademo.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yeyangtao
 * @since 2022/7/21 17:55
 */
@RestController
public class DemoController {
    private static EventBus eventBus = new EventBus();

    @GetMapping("demo")
    public String demo() {
        eventBus.register(new Consumer());
        eventBus.post(User.builder().build());
        eventBus.post("66");
        return "666";
    }
}
